<?php /* Smarty version 2.6.26, created on 2013-10-06 05:52:08
         compiled from ../templates/admin/manager_info.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', '../templates/admin/manager_info.html', 8, false),array('function', 'html_options', '../templates/admin/manager_info.html', 78, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "../templates/admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div class="main-div">
<form name="theForm" method="post" action="manager.php<?php if ($this->_tpl_vars['action'] != ''): ?>?act=<?php echo $this->_tpl_vars['action']; ?>
<?php endif; ?>" enctype="multipart/form-data" onsubmit="return validate();">
<table width="100%">
  <tr>
    <td class="label">用户名</td>
    <td>
      <input type="text" name="user_name" maxlength="20" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['user']['user_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" size="34"/><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
  <tr>
    <td class="label">Email地址</td>
    <td>
      <input type="text" name="email" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['user']['email'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
 <?php if ($this->_tpl_vars['judge_action'] == 'add'): ?>
  <tr>
    <td class="label">密码</td>
    <td>
      <input type="password" name="password" maxlength="32" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
  <tr>
    <td class="label">确认密码</td>
    <td>
      <input type="password" name="pwd_confirm" maxlength="32" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
  <?php endif; ?>
<!-- 
  <?php if ($this->_tpl_vars['action'] != 'add'): ?>
  <tr>
    <td class="label">
      <a href="javascript:showNotice('passwordNotic');" title="<?php echo $this->_tpl_vars['lang']['form_notice']; ?>
">
        <img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_tpl_vars['lang']['form_notice']; ?>
"></a><?php echo $this->_tpl_vars['lang']['old_password']; ?>
</td>
    <td>
      <input type="password" name="old_password" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>

      <br /><span class="notice-span" <?php if ($this->_tpl_vars['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="passwordNotic"><?php echo $this->_tpl_vars['lang']['password_notic']; ?>
</span></td>
  </tr>
  <tr>
    <td class="label"><?php echo $this->_tpl_vars['lang']['new_password']; ?>
</td>
    <td>
      <input type="password" name="new_password" maxlength="32" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
  <tr>
    <td class="label"><?php echo $this->_tpl_vars['lang']['pwd_confirm']; ?>
</td>
    <td>
      <input type="password" name="pwd_confirm" value="" size="34" /><?php echo $this->_tpl_vars['lang']['require_field']; ?>
</td>
  </tr>
  <?php if ($this->_tpl_vars['user']['agency_name']): ?>
  <tr>
    <td class="label"><?php echo $this->_tpl_vars['lang']['agency']; ?>
</td>
    <td><?php echo $this->_tpl_vars['user']['agency_name']; ?>
</td>
  </tr>
  <?php endif; ?>
  <?php endif; ?>
 -->
   <?php if ($this->_tpl_vars['role_list']): ?>
    <tr>
   <td class="label">角色选择</td>
    <td>
      <select name="select_role">
        <option value="">请选择...</option>
        <?php $_from = $this->_tpl_vars['role_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
        <option value="<?php echo $this->_tpl_vars['list']['role_id']; ?>
" <?php if ($this->_tpl_vars['list']['role_id'] == $this->_tpl_vars['user']['role_id']): ?> selected="selected" <?php endif; ?> ><?php echo $this->_tpl_vars['list']['role_name']; ?>
</option>
        <?php endforeach; endif; unset($_from); ?>
      </select>
    </td>
  </tr>
  <?php endif; ?>
<!-- 
  <?php if ($this->_tpl_vars['action'] == 'modif'): ?>
  <tr>
  <td align="left" class="label"><?php echo $this->_tpl_vars['lang']['edit_navi']; ?>
</td>
  <td>
      <table style="width:300px" cellspacing="0">
        <tr>
        <td valign="top">
          <input type="hidden" name="nav_list[]" id="nav_list[]" />
          <select name="menus_navlist" id="menus_navlist" multiple="true" style="width: 120px; height: 180px" onclick="setTimeout('toggleButtonSatus()', 1);">
          <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['nav_arr']), $this);?>

          </select></td>
        <td align="center">
         <input type="button" class="button" value="<?php echo $this->_tpl_vars['lang']['move_up']; ?>
" id="btnMoveUp" onclick="moveOptions('up')" disabled="true" />
         <input type="button" class="button" value="<?php echo $this->_tpl_vars['lang']['move_down']; ?>
" id="btnMoveDown" onclick="moveOptions('down')" disabled="true" />
         <input type="button" value="<?php echo $this->_tpl_vars['lang']['add_nav']; ?>
" id="btnAdd" onclick="JavaScript:addItem(theForm.all_menu_list,theForm.menus_navlist); this.disabled=true; " class="button" disabled="true" /><br />
         <input type="button" value="<?php echo $this->_tpl_vars['lang']['remove_nav']; ?>
" onclick="JavaScript:delItem(theForm.menus_navlist); toggleButtonSatus()" class="button" disabled="true" id="btnRemove" /></td>
        <td>
          <select id="all_menu_list" name="all_menu_list" size="15" multiple="true" style="width:150px; height: 180px" onchange="toggleAddButton()">
            <?php $_from = $this->_tpl_vars['menus']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['menu']):
?>
              <?php if ($this->_tpl_vars['key'] != 'admin_home' && $this->_tpl_vars['menus'][$this->_tpl_vars['key']]): ?>
              <option value="" style="font-weight:bold;"><?php echo $this->_tpl_vars['lang'][$this->_tpl_vars['key']]; ?>
</option>
              <?php $_from = $this->_tpl_vars['menus'][$this->_tpl_vars['key']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['item']):
?>
              <option value="<?php echo $this->_tpl_vars['item']; ?>
">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->_tpl_vars['lang'][$this->_tpl_vars['k']]; ?>
</option>
              <?php endforeach; endif; unset($_from); ?>
              <?php endif; ?>
             <?php endforeach; endif; unset($_from); ?>
           </select></td>
        </tr>
      </table></td>
  </tr>
  <?php endif; ?>
 -->
  <tr>
    <td colspan="2" align="center">
      <input type="submit" value="确定" class="button" />&nbsp;&nbsp;&nbsp;
      <input type="reset" value="重置" class="button" />
      <input type="hidden" name="act" value="<?php echo $this->_tpl_vars['action']; ?>
" />
      <input type="hidden" name="id" value="<?php echo $this->_tpl_vars['user']['user_id']; ?>
" /></td>
  </tr>
</table>
</form>
</div>

<script language="JavaScript">
var action = "<?php echo $this->_tpl_vars['action']; ?>
";
<!--
{literal}
document.forms['theForm'].elements['user_name'].focus();
onload = function()
{
    // ��ʼ��鶩��
    startCheckOrder();
}

/**
 * �л����Ӱ�ť��״̬
 */
function toggleAddButton()
{
	var sel = document.getElementById("all_menu_list");
	document.getElementById("btnAdd").disabled = (sel.selectedIndex > -1) ? false : true;
}

/**
 * �л��Ƴ������ƣ����ư�ť״̬
 */
function toggleButtonSatus()
{
	var sel = document.getElementById("menus_navlist");
	document.getElementById("btnRemove").disabled = (sel.selectedIndex > -1) ? false : true;
	document.getElementById("btnMoveUp").disabled = (sel.selectedIndex > -1) ? false : true;
	document.getElementById("btnMoveDown").disabled = (sel.selectedIndex > -1) ? false : true;
}

/**
 * �ƶ�ѡ�����б���
 */
function moveOptions(direction)
{
	var sel = document.getElementById('menus_navlist');
	if (sel.selectedIndex == -1)
	{
		return;
	}

	len = sel.length
	for (i = 0; i < len; i++)
	{
	if (sel.options[i].selected)
	{
	if (i == 0 && direction == 'up')
	{
	return;
	}

	newOpt = sel.options[i].cloneNode(true);

	sel.removeChild(sel.options[i]);
	tarOpt = (direction == "up") ? sel.options[i-1] : sel.options[i+1]
	sel.insertBefore(newOpt, tarOpt);
	newOpt.selected = true;
	break;
	}
	}
	}

	/**
	* ���?��������
	*/
	function validate()
	{
	get_navlist();

	validator = new Validator("theForm");
	validator.password = function (controlId, msg)
	{
	var obj = document.forms[this.formName].elements[controlId];
	obj.value = Utils.trim(obj.value);
	if (!(obj.value.length >= 6 && /\d+/.test(obj.value) && /[a-zA-Z]+/.test(obj.value)))
	{
	this.addErrorMsg(msg);
	}

	}

	validator.required("user_name", user_name_empty);
	validator.required("email", email_empty, 1);
	validator.isEmail("email", email_error);

	if (action == "add")
	{
	if (document.forms['theForm'].elements['password'])
	{
	validator.password("password", password_invaild);
	validator.eqaul("password", "pwd_confirm", password_error);
	}
  }
  if (action == "edit" || action == "modif")
  {
  if (document.forms['theForm'].elements['old_password'].value.length > 0)
  {
  validator.password("new_password", password_invaild);
  		validator.eqaul("new_password", "pwd_confirm", password_error);
  }
  }

  				return validator.passed();
  }

  function get_navlist()
  {
  if (!document.getElementById('nav_list[]'))
  {
    return;
  }

  document.getElementById('nav_list[]').value = joinItem(document.getElementById('menus_navlist'));
  //alert(document.getElementById('nav_list[]').value);
  }
  //-->
  {/literal}
</script>